import { Column, Entity, PrimaryGeneratedColumn, Unique } from 'typeorm';

/**
 * 组件
 */
@Entity('admin_user')
export class User {
  // 自增Id
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    comment: '用户名',
    nullable: true,
  })
  @Unique(['username'])
  username: string;

  @Column({
    comment: '密码',
    nullable: true,
  })
  password: string;

  @Column({
    comment: '角色',
    default: '',
  })
  role: string;

  @Column({
    comment: '昵称',
    default: '',
  })
  nickname: string;

  @Column({
    comment: '状态',
    default: '',
  })
  active: string;

  @Column({
    comment: '头像',
    nullable: true,
  })
  avatar: string;

}
